# 类的定义
class Car:
    wheel = 4

    def driver(self):
        print('能跑')


# 通过对象调用类的属性和类的方法
car = Car()
print(car.wheel)
# car.drive()

# 案例：
'''
----案例：学生类----
编写一个学生类：
属性：姓名、性别、类别默认为people
方法：hello
'''

class Student


class Student:
    category = 'people'

    def __init__(self, name, sex):
        self.name = name
        self.sex = sex

    def hello(self):
        print(f'大家好，我叫{self.name}')


zhangsan = Student('zhangsan', 'nan')
print(zhangsan.category)
zhangsan.hello()

lisi = Student('lisi', 'nan')
lisi.hello()
